/*
 * File: current_ctl_pi.h
 *
 * Code generated for Simulink model 'current_ctl_pi'.
 *
 * Model version                  : 4.8
 * Simulink Coder version         : 24.1 (R2024a) 19-Nov-2023
 * C/C++ source code generated on : Mon Jun 16 13:49:50 2025
 *
 * Target selection: ert.tlc
 * Embedded hardware selection: ARM Compatible->ARM Cortex
 * Code generation objectives:
 *    1. Execution efficiency
 *    2. Traceability
 * Validation result: Not run
 */

#ifndef current_ctl_pi_h_
#define current_ctl_pi_h_
#ifndef current_ctl_pi_COMMON_INCLUDES_
#define current_ctl_pi_COMMON_INCLUDES_
#include "rtwtypes.h"
#endif                                 /* current_ctl_pi_COMMON_INCLUDES_ */

/* Forward declaration for rtModel */
typedef struct current_ctl_pi_tag_RTM current_ctl_pi_RT_MODEL;

/* Block signals and states (default storage) for model 'current_ctl_pi' */
typedef struct
{
    real32_T id_ctl_i_sum;             /* '<S7>/1//s' */
    real32_T iq_ctl_i_sum;             /* '<S8>/1//s' */
}
current_ctl_pi_DW_f;

/* instance parameters, for model 'current_ctl_pi' */
typedef struct
{
    real32_T bw;                       /* Variable: bw
                                        * Referenced by:
                                        */
    real32_T dc_bus_limit;             /* Variable: dc_bus_limit
                                        * Referenced by:
                                        */
    real32_T fs;                       /* Variable: fs
                                        * Referenced by:
                                        */
    real32_T ld;                       /* Variable: ld
                                        * Referenced by:
                                        */
    real32_T lq;                       /* Variable: lq
                                        * Referenced by:
                                        */
    real32_T r;                        /* Variable: r
                                        * Referenced by:
                                        */
}
current_ctl_pi_InstP;

/* Parameters (default storage) */
struct current_ctl_pi_P_
{
    real32_T Gain1_Gain;               /* Computed Parameter: Gain1_Gain
                                        * Referenced by: '<S2>/Gain1'
                                        */
    real32_T Constant4_Value;          /* Computed Parameter: Constant4_Value
                                        * Referenced by: '<S3>/Constant4'
                                        */
    real32_T us_gainval;               /* Computed Parameter: us_gainval
                                        * Referenced by: '<S7>/1//s'
                                        */
    real32_T us_IC;                    /* Computed Parameter: us_IC
                                        * Referenced by: '<S7>/1//s'
                                        */
    real32_T us_gainval_n;             /* Computed Parameter: us_gainval_n
                                        * Referenced by: '<S8>/1//s'
                                        */
    real32_T us_IC_i;                  /* Computed Parameter: us_IC_i
                                        * Referenced by: '<S8>/1//s'
                                        */
    real32_T Gain1_Gain_c;             /* Computed Parameter: Gain1_Gain_c
                                        * Referenced by: '<S4>/Gain1'
                                        */
};

/* Parameters (default storage) */
typedef struct current_ctl_pi_P_ current_ctl_pi_P;

/* Real-time Model Data Structure */
struct current_ctl_pi_tag_RTM
{
    const char_T **errorStatus;
    current_ctl_pi_InstP *current_ctl_pi_InstP_ref;
};

typedef struct
{
    current_ctl_pi_DW_f rtdw;
    current_ctl_pi_RT_MODEL rtm;
}
current_ctl_pi_MdlrefDW;

extern current_ctl_pi_P current_ctl_pi_rt_P;

/* Model reference registration function */
extern void current_ctl_pi_initialize(const char_T **rt_errorStatus,
    current_ctl_pi_RT_MODEL *const current_ctl_pi_rt_M);
extern void current_ctl_pi_Init(current_ctl_pi_DW_f *localDW);
extern void current_ctl_piTID0(void);
extern void current_ctl_piTID1(current_ctl_pi_RT_MODEL * const
    current_ctl_pi_rt_M, const real32_T rtu_idq_tar_A[2], const real32_T
    rtu_iabc_now_A[3], const real32_T *rtu_elec_theta_rad, real32_T
    rty_sv_uabc_V[3], real32_T rty_idq_now_A[2], current_ctl_pi_DW_f *localDW);

/*-
 * The generated code includes comments that allow you to trace directly
 * back to the appropriate location in the model.  The basic format
 * is <system>/block_name, where system is the system number (uniquely
 * assigned by Simulink) and block_name is the name of the block.
 *
 * Use the MATLAB hilite_system command to trace the generated code back
 * to the model.  For example,
 *
 * hilite_system('<S3>')    - opens system 3
 * hilite_system('<S3>/Kp') - opens and selects block Kp which resides in S3
 *
 * Here is the system hierarchy for this model
 *
 * '<Root>' : 'current_ctl_pi'
 * '<S1>'   : 'current_ctl_pi/current_ctl_pi'
 * '<S2>'   : 'current_ctl_pi/current_ctl_pi/clark_park_transform '
 * '<S3>'   : 'current_ctl_pi/current_ctl_pi/current_ctl_pi'
 * '<S4>'   : 'current_ctl_pi/current_ctl_pi/inverse_park_clark_transform'
 * '<S5>'   : 'current_ctl_pi/current_ctl_pi/svpwm '
 * '<S6>'   : 'current_ctl_pi/current_ctl_pi/current_ctl_pi/MATLAB Function'
 * '<S7>'   : 'current_ctl_pi/current_ctl_pi/current_ctl_pi/id_pi_ctl'
 * '<S8>'   : 'current_ctl_pi/current_ctl_pi/current_ctl_pi/iq_pi_ctl'
 */

/*-
 * Requirements for '<Root>': current_ctl_pi

 */
#endif                                 /* current_ctl_pi_h_ */

/*
 * File trailer for generated code.
 *
 * [EOF]
 */
